Initiate a state change on a host, such as a shutdown or restart.
MarkLogic Server returns status code 202 (Accepted). The response body includes the last start time. If the operation is asynchronous, a reference to the timestamp service is included in the Location header and the response data. Use it to confirm successful completion.
manage-admin
role, or the following
privilege: http://marklogic.com/xdmp/privileges/manage-admin
http://marklogic.com/xdmp/privileges/manage
Restart is an asynchronous operation. You can use the timestamp reference returned in the Location header and the response body to test for successful completion of the restart. For details, see GET /admin/v1/timestamp.
dynamic-host
host-name
group
bind-port
foreign-bind-port
zone
bootstrap-host
host-mode
host-mode-description
$ curl --anyauth --user password:password -X POST -i --data "state=restart" \ -H "Content-type: application/x-www-form-urlencoded" \ http://localhost:8002/manage/v2/hosts/my-host ==> MarkLogic Server is restarted on the host my-host. MarkLogic Server returns output similar to the following. Use the timestamp reference in the Location header or the response body to check on the status. HTTP/1.1 202 Accepted Content-type: application/xml Cache-Control: no-cache Expires: -1 Location: /admin/v1/timestamp Server: MarkLogic Content-Length: 291 Connection: Keep-Alive Keep-Alive: timeout=5 <restart xmlns="http://marklogic.com/manage"> <last-startup host-id="13544732455686476949"> 2013-09-21T09:55:40.929792-07:00 </last-startup> <link> <kindref>timestamp</kindref> <uriref>/admin/v1/timestamp</uriref> </link> <message>Check for new timestamp to verify host restart.</message> </restart> The following is the equivalent JSON response data: { "restart": { "last-startup": { "host-id":"13544732455686476949", "value":"2013-09-23T09:16:32.897234-07:00" }, "link":{ "kindref":"timestamp", "uriref":"\/admin\/v1\/timestamp" }, "message":"Check for new timestamp to verify host restart." }}
$ curl --anyauth --user user:password -X POST -i --data "state=shutdown" \ -H "Content-type: application/x-www-form-urlencoded" \ http://localhost:8002/manage/v2/hosts/my-host?format=JSON ==> MarkLogic Server is shut down on the host my-host. MarkLogic Server returns output similar to the following. HTTP/1.1 202 Accepted Content-type: application/json Cache-Control: no-cache Expires: -1 Server: MarkLogic Content-Length: 148 Connection: Keep-Alive Keep-Alive: timeout=5 { "shutdown": { "last-startup":"2013-09-23T09:10:22.375938-07:00", "message":"Shutdown of host my-host (13544732455686476949) initiated." }}